SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[recipe_silo](
	[id_recipe_silo] [uniqueidentifier] NOT NULL,
	[identifier] [nvarchar](128) NULL,
	[description] [nvarchar](1024) NULL,
	[is_white] [bit] NULL,
	[x_created] [datetime] NULL,
	[x_modified] [datetime] NULL,
PRIMARY KEY CLUSTERED 
(
	[id_recipe_silo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY],
UNIQUE NONCLUSTERED 
(
	[id_recipe_silo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[recipe_silo] ADD  DEFAULT (newsequentialid()) FOR [id_recipe_silo]
GO

ALTER TABLE [dbo].[recipe_silo] ADD  DEFAULT (getutcdate()) FOR [x_created]
GO


Insert Into
	[recipe_silo]
(
	[identifier]
)
	Select Distinct
		[recipe_name]
	From
		[receive_data]

Go

Update
	[recipe_silo]
Set
	[is_white] = Case When [identifier] Like N'%bily%' Then 1 Else 0 End

Go